/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmThongKeDiaOc.java
 *
 * Created on May 31, 2011, 2:18:00 PM
 */

package Presentation;

import RSCall.DuongRSc;
import RSCall.KhachHangRSc;
import RSCall.PhuongRSc;
import RSCall.QuanRSc;
import RSCall.ThanhPhoRSc;
import RSCall.ThongKeDiaOcRSc;
import Entities.KHACHHANG;
import Entities.THONGKEDIAOC;
import java.util.ArrayList;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author VooKa
 */
public class frmThongKeDiaOc extends javax.swing.JInternalFrame {

    /** Creates new form frmThongKeDiaOc */
    public frmThongKeDiaOc() {
        initComponents();
        Creation();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        cbxMaKH = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        chbxMa = new javax.swing.JCheckBox();
        cbxTrangThai = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        tbxTen = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        chbxTen = new javax.swing.JCheckBox();
        chbxTrangThai = new javax.swing.JCheckBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();

        setTitle(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("titlefrmThongKeDiaOc"));
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("search")));

        jLabel1.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        jLabel1.setText(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("customerid"));

        chbxMa.setSelected(true);
        chbxMa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chbxMaActionPerformed(evt);
            }
        });

        cbxTrangThai.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Chưa bán", "Đã bán" }));

        jLabel3.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        jLabel3.setText(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("state"));

        jLabel2.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        jLabel2.setText(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("hoten"));

        jButton1.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        jButton1.setText(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("search"));
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        jButton2.setText(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("list"));
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        chbxTen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chbxTenActionPerformed(evt);
            }
        });

        chbxTrangThai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chbxTrangThaiActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3)
                    .addComponent(jLabel1))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(tbxTen, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)
                    .addComponent(cbxMaKH, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cbxTrangThai, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(29, 29, 29)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chbxTen)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chbxMa)
                            .addComponent(chbxTrangThai))
                        .addGap(54, 54, 54)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2))))
                .addContainerGap(23, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(cbxMaKH, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(chbxMa))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(tbxTen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(chbxTen))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(cbxTrangThai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(chbxTrangThai)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jButton1)
                        .addGap(49, 49, 49)
                        .addComponent(jButton2)))
                .addContainerGap(23, Short.MAX_VALUE))
        );

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(224, 224, 224)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 963, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(27, 27, 27)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(106, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
        // TODO add your handling code here:
        this.LoadData();
        this.LoadComBoBox();
    }//GEN-LAST:event_formInternalFrameOpened

    private void chbxMaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chbxMaActionPerformed
        // TODO add your handling code here:
        if(chbxMa.isSelected())
        {
            chbxTen.setSelected(false);
            chbxTrangThai.setSelected(false);
        }
    }//GEN-LAST:event_chbxMaActionPerformed

    private void chbxTenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chbxTenActionPerformed
        // TODO add your handling code here:
        if(chbxTen.isSelected())
        {
            chbxMa.setSelected(false);
            chbxTrangThai.setSelected(false);
        }
    }//GEN-LAST:event_chbxTenActionPerformed

    private void chbxTrangThaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chbxTrangThaiActionPerformed
        // TODO add your handling code here:
        if(chbxTrangThai.isSelected())
        {
            chbxMa.setSelected(false);
            chbxTen.setSelected(false);
        }
    }//GEN-LAST:event_chbxTrangThaiActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        this.LoadData();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        if(chbxMa.isSelected())
        {
            try
            {
                ArrayList<THONGKEDIAOC> lst = dbTKDiaOc.GetRowsByMaKH((String)cbxMaKH.getSelectedItem());
                DefaultTableModel dtm = new DefaultTableModel();
                dtm.addColumn("STT");
                dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("customerid"));
                dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("hoten"));
                dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("propertyid"));
                dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("state"));
                dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("cost"));
                dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("address"));
                THONGKEDIAOC _t = null;
                for(int i=0;i<lst.size();i++)
                {
                    Vector _v = new Vector();
                    _t = lst.get(i);
                    _v.add(i+1);
                    _v.add(_t.getMaKH());
                    _v.add(_t.getHoTen().trim());
                    _v.add(_t.getMaDiaOC());
                    _v.add(_t.getTrangThai());
                    _v.add(_t.getGiaBan());
                    String tenThanhPho = dbThanhPho.GetRowByID(_t.getDiaChiDiaOc().getMaThanhPho()).getTenThanhPho().trim();
                    String tenQuan = dbQuan.GetRowByID(_t.getDiaChiDiaOc().getMaQuan()).getTenQuan().trim();
                    String tenPhuong = dbPhuong.GetRowByID(_t.getDiaChiDiaOc().getMaPhuong()).getTenPhuong().trim();
                    String tenDuong = dbDuong.GetRowByID(_t.getDiaChiDiaOc().getMaDuong()).getTenDuong().trim();
                    String diaChiCT = _t.getDiaChiDiaOc().getDiaChiCT().trim();
                    String diaChi = diaChiCT + " " + tenDuong + " " + tenPhuong + " " + tenQuan + " " + tenThanhPho;
                    _v.add(diaChi);
                    dtm.addRow(_v);
                }
                this.jTable1.setModel(dtm);
                this.jTable1.getColumnModel().getColumn(0).setPreferredWidth(20);
            }
            catch(Exception e)
            {
                JOptionPane.showMessageDialog(this, e.toString());
            }
        }
        else
            if(chbxTen.isSelected())
            {
                if(tbxTen.getText().isEmpty())
                    JOptionPane.showMessageDialog(this, java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("mustenterhoten"));
                else
                {
                    try
                    {
                        ArrayList<THONGKEDIAOC> lst = dbTKDiaOc.GetRowsByHoTen(tbxTen.getText());
                        DefaultTableModel dtm = new DefaultTableModel();
                        dtm.addColumn("STT");
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("customerid"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("hoten"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("propertyid"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("state"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("cost"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("address"));
                        THONGKEDIAOC _t = null;
                        for(int i=0;i<lst.size();i++)
                        {
                            Vector _v = new Vector();
                            _t = lst.get(i);
                            _v.add(i+1);
                            _v.add(_t.getMaKH());
                            _v.add(_t.getHoTen().trim());
                            _v.add(_t.getMaDiaOC());
                            _v.add(_t.getTrangThai());
                            _v.add(_t.getGiaBan());
                            String tenThanhPho = dbThanhPho.GetRowByID(_t.getDiaChiDiaOc().getMaThanhPho()).getTenThanhPho().trim();
                            String tenQuan = dbQuan.GetRowByID(_t.getDiaChiDiaOc().getMaQuan()).getTenQuan().trim();
                            String tenPhuong = dbPhuong.GetRowByID(_t.getDiaChiDiaOc().getMaPhuong()).getTenPhuong().trim();
                            String tenDuong = dbDuong.GetRowByID(_t.getDiaChiDiaOc().getMaDuong()).getTenDuong().trim();
                            String diaChiCT = _t.getDiaChiDiaOc().getDiaChiCT().trim();
                            String diaChi = diaChiCT + " " + tenDuong + " " + tenPhuong + " " + tenQuan + " " + tenThanhPho;
                            _v.add(diaChi);
                            dtm.addRow(_v);
                        }
                        this.jTable1.setModel(dtm);
                        this.jTable1.getColumnModel().getColumn(0).setPreferredWidth(20);
                    }
                    catch(Exception e)
                    {
                        JOptionPane.showMessageDialog(this, e.toString());
                    }
                }
            }
            else
                if(chbxTrangThai.isSelected())
                {
                    try
                    {
                        ArrayList<THONGKEDIAOC> lst = dbTKDiaOc.GetRowsByTrangThai((String)cbxTrangThai.getSelectedItem());
                        DefaultTableModel dtm = new DefaultTableModel();
                        dtm.addColumn("STT");
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("customerid"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("hoten"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("propertyid"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("state"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("cost"));
                        dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("address"));
                        THONGKEDIAOC _t = null;
                        for(int i=0;i<lst.size();i++)
                        {
                            Vector _v = new Vector();
                            _t = lst.get(i);
                            _v.add(i+1);
                            _v.add(_t.getMaKH());
                            _v.add(_t.getHoTen().trim());
                            _v.add(_t.getMaDiaOC());
                            _v.add(_t.getTrangThai());
                            _v.add(_t.getGiaBan());
                            String tenThanhPho = dbThanhPho.GetRowByID(_t.getDiaChiDiaOc().getMaThanhPho()).getTenThanhPho().trim();
                            String tenQuan = dbQuan.GetRowByID(_t.getDiaChiDiaOc().getMaQuan()).getTenQuan().trim();
                            String tenPhuong = dbPhuong.GetRowByID(_t.getDiaChiDiaOc().getMaPhuong()).getTenPhuong().trim();
                            String tenDuong = dbDuong.GetRowByID(_t.getDiaChiDiaOc().getMaDuong()).getTenDuong().trim();
                            String diaChiCT = _t.getDiaChiDiaOc().getDiaChiCT().trim();
                            String diaChi = diaChiCT + " " + tenDuong + " " + tenPhuong + " " + tenQuan + " " + tenThanhPho;
                            _v.add(diaChi);
                            dtm.addRow(_v);
                        }
                        this.jTable1.setModel(dtm);
                        this.jTable1.getColumnModel().getColumn(0).setPreferredWidth(20);
                    }
                    catch(Exception e)
                    {
                        JOptionPane.showMessageDialog(this, e.toString());
                    }
                }
    }//GEN-LAST:event_jButton1ActionPerformed
    private void LoadData(){
        try
        {
            ArrayList<THONGKEDIAOC> lst = dbTKDiaOc.GetAllRows();
            DefaultTableModel dtm = new DefaultTableModel();
            dtm.addColumn("STT");
            dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("customerid"));
            dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("hoten"));
            dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("propertyid"));
            dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("state"));
            dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("cost"));
            dtm.addColumn(java.util.ResourceBundle.getBundle("Presentation/" + frmMain.resource).getString("address"));
            THONGKEDIAOC _t = null;
            for(int i=0;i<lst.size();i++)
            {
                Vector _v = new Vector();
                _t = lst.get(i);
                _v.add(i+1);
                _v.add(_t.getMaKH());
                _v.add(_t.getHoTen().trim());
                _v.add(_t.getMaDiaOC());
                _v.add(_t.getTrangThai());
                _v.add(_t.getGiaBan());
                String tenThanhPho = dbThanhPho.GetRowByID(_t.getDiaChiDiaOc().getMaThanhPho()).getTenThanhPho().trim();
                String tenQuan = dbQuan.GetRowByID(_t.getDiaChiDiaOc().getMaQuan()).getTenQuan().trim();
                String tenPhuong = dbPhuong.GetRowByID(_t.getDiaChiDiaOc().getMaPhuong()).getTenPhuong().trim();
                String tenDuong = dbDuong.GetRowByID(_t.getDiaChiDiaOc().getMaDuong()).getTenDuong().trim();
                String diaChiCT = _t.getDiaChiDiaOc().getDiaChiCT().trim();
                String diaChi = diaChiCT + " " + tenDuong + " " + tenPhuong + " " + tenQuan + " " + tenThanhPho;
                _v.add(diaChi);
                dtm.addRow(_v);
            }
            this.jTable1.setModel(dtm);
            this.jTable1.getColumnModel().getColumn(0).setPreferredWidth(20);
        }
        catch(Exception e)
        {
            JOptionPane.showMessageDialog(this, e.toString());
        }
    }
    //load dữ liệu cho combobox mã khách hàng
    private void LoadComBoBox(){
        try
        {
            ArrayList<KHACHHANG> lst = dbKhachHang.GetAllRows();
            for(int i=0;i<lst.size();i++)
            {
                KHACHHANG _k = lst.get(i);
                cbxMaKH.addItem(_k.getMaKH());
            }
        }
        catch(Exception e)
        {
            JOptionPane.showMessageDialog(this, e.toString());
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox cbxMaKH;
    private javax.swing.JComboBox cbxTrangThai;
    private javax.swing.JCheckBox chbxMa;
    private javax.swing.JCheckBox chbxTen;
    private javax.swing.JCheckBox chbxTrangThai;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField tbxTen;
    // End of variables declaration//GEN-END:variables
    private RSCall.KhachHangRSc dbKhachHang;
    private RSCall.ThongKeDiaOcRSc dbTKDiaOc;
    
    private RSCall.ThanhPhoRSc dbThanhPho;
    private RSCall.QuanRSc dbQuan;
    private RSCall.PhuongRSc dbPhuong;
    private RSCall.DuongRSc dbDuong;
    private void Creation(){
        try {
            dbKhachHang = new KhachHangRSc();
            dbTKDiaOc = new ThongKeDiaOcRSc();
            dbThanhPho = new ThanhPhoRSc();
            dbQuan = new QuanRSc();
            dbPhuong = new PhuongRSc();
            dbDuong = new DuongRSc();   
        } catch (Exception ex) {
            Logger.getLogger(frmThongKeDiaOc.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
